<!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>vue1</title>
        <script src="js/vue.js"></script>
    </head>
    <body>
        <div id="app">
            <p>
                {{ tiem | dateFormart("yyyy-MM-dd") }}
            </p>
        </div>
        <script>
            Vue.filter("dateFormart",  function (value, fmStr) {
                console.log(fmStr)
                let date = new Date(value)
                let year = date.getFullYear()
                let month = date.getMonth() + 1 + ""
                let day = date.getDay() +""
                let hour = date.getHours() + ""
                let minute = date.getMinutes() + ""
                let second = date.getSeconds() + ""
                if(fmStr && fmStr === 'yyyy-MM-dd'){
                    return `${year}年${month.padStart(2, "0")}月${day.padStart(2, "0")}日`
                }
                return `${year}年${month.padStart(2, "0")}月${day.padStart(2, "0")}日 ${hour.padStart(2, "0")}时${minute.padStart(2, "0")}分${second.padStart(2, "0")}秒`
            });
            let vue = new Vue({
        // 告诉vue的实例对象，将来需要控制界面上的那个区域
                el:'#app',
                data:{
                    tiem:Date.now()
                }
            });
        </script>
    </body>
</html>